package cn.tedu.springmvc.controller;

import cn.tedu.springmvc.pojo.entity.User;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.Arrays;

@Controller
public class UserController {
    @RequestMapping("/login")
    @ResponseBody
    public String login(String username, String password) {
//        System.out.println("UserController.login()");
        return "登陆成功！登录的用户名是："+username + ",密码是："+password;
    }
    @RequestMapping("/reg")
    @ResponseBody
    public String reg(User user){
        return user.toString();
    }
    @RequestMapping("/like")
    @ResponseBody
    public String like(String[] likes){
        return Arrays.toString(likes);
    }
}
